
#include "member_BElevation.h"

using namespace BWE;

member_BElevation::member_BElevation(BElevation* elevation)
{
	boss = elevation;
	dirty = false;
	format = Format_Float;
	formatLen = sizeof(float);
}
member_BElevation::~member_BElevation()
{

}

bool member_BElevation::realize()
{
	if (size == BSize() || formatLen == 0)
	{
		boss->clear();
		return false;
	}

	int length = formatLen * size.width() * size.height();

	if (data)
	{
		data = new BByteArray(length);
		return true;
	}
	if (data->size() == length)
	{
		data = new BByteArray(length);
		return true;
	}

	return true;
}
